﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zocono.Infrastructure.Common;
using Zocono.WCS.Domain.EquipmentProcessDomain;

namespace Zocono.WCS.Domain.ProcessModuleDomain
{
    public class ProcessModulePlanarService : IProcessMuduleService
    {
        private readonly IProcessPlanarService _planarEquipmentProcessService;
        private readonly ILogUtil _logUtil;
        public ProcessModulePlanarService(IProcessPlanarService planarEquipmentProcessService, ILogUtil logUtil)
        {
            _planarEquipmentProcessService = planarEquipmentProcessService;
            _logUtil = logUtil;
        }

        public async Task ProcessDbObjectAsync(ProcessModule processModule/*, ProcessModule plcStateProcessModule*/)
        {
            foreach (var planarEq in processModule.equipmentDbObjects)
            {
                if (planarEq != null)
                    await _planarEquipmentProcessService.ProcessAsync(planarEq/*, plcStateProcessModule*/);
                else
                    _logUtil.Info("空值报警：请确认planarEq是否为空");
            }
        }//singer

    }
}
